<template>
  <div >
      <router-view></router-view>
      <footerNav v-if="is_show"></footerNav>
  </div>
</template>

<script>
//  import footerNav from './components/footerNav.vue'
// 在vue中 @代表 src  引入的 快捷给你配置好的方式 
 import footerNav from '@/components/footerNav.vue'
 import axios from 'axios'
export default {
 
  props:[],
  components: {
   footerNav
  },
  data() {
    return {
       is_show:true
    };
  },
  
  methods: {},
 
  computed: {},
 
  watch: {},
 
  filters: {},
 
  beforeCreate() {},
 
  created() {
    this.eventbus.$on('footnav',(flag)=>{
        this.is_show = flag
    })


      this.eventbus2.$on('rocket1',(flag1)=>{
        console.log('falg1',flag1)
    })
  },
 
  beforeMount() {},
 
  mounted() {
    // 刷新下 出去迪士尼外面吃饭 现在要进迪士尼  需要进行token和后端 换取身份然后进入 
    if(this.$store.state.token) {
       axios({
         methods:'get',
         url:'http://127.0.0.1:3000/userinfo',
         params:{
          //  这个动作 就像把  密钥的 门票交给保安 等待保安 反解 
           token:this.$store.state.token
         }
       }).then((res)=>{
         console.log('进来 token换票的then里面了') 
         if(res.data.code == '888') {
             alert('登录校验失败请重试') 
            return 
         }

         this.$store.commit('usermobile',res.data.info2.mobile)
       })
    }
  },
 
  beforeUpdate() {},
 
  updated() {},
 
  beforeDestroy() {},
 
  destroyed() {},
}
</script>


<style  lang='scss'>
@import "./assets/scss/reset.scss";
</style>
